home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-07 | 1.4 KB | 44 lines | [TEXT/ttxt] |
- ;; Simple debugger for Pixie Scheme. Not very useful.
-
- ; An environment list is a non–empty list whose last member
- ; is a vector, each of whose elements is in turn a list of symbols.
- ; All other members of the environment list are lists of symbols.
- ; The last member consists of all symbols that are bound at top–level.
- ; The first member consists of all symbols bound in the innermost
- ; lexical scope of the environment, the second member consists of all
- ; symbols bound in the next lexical scope, and so on.
-
- (define (e::debug env-list)
- (newline) (newline)
- (display "Run–Time Stack:") (newline)
- (display "==============") (newline)
- (e::show-stack)
- (display "Run–Time Stack (printed):") (newline)
- (display "========================") (newline)
- (e::write-stack) (newline) (newline)
- (display "Dynamic Environments:") (newline)
- (display "====================") (newline)
- (e::show-envs env-list 0) (newline)
- (e::reset))
-
- (define (e::show-envs env-list n)
- (if env-list
- (begin
- (if (not (vector? (car env-list)))
- (e::show-env (car env-list) n))
- (e::show-envs (cdr env-list) (+ n 1)))))
-
- (define (e::show-env env n)
- (display "-------- Environment ") (display n)
- (display " of Environment List --------") (newline)
- (e::show-env-1 env))
-
- (define (e::show-env-1 env)
- (if env
- (begin
- (display " ") (e::show-symbol (car env)) (newline)
- (e::show-env-1 (cdr env)))))
-
- (define (e::show-symbol s)
- (display s))
-